const vFilter = {
  moduleTypeFilter(type) {
    const statusMap = {
      0: 'success', // rtcgw
      1: 'danger', // zwmp
      2: 'info', // sip
      3: 'warning', // web
      4: 'primary' // oam
    }
    return statusMap[type]
  },
  moduleFilter(module) {
    if (module === 0) {
      return 'web'
    }
    return module
  },
  sessionStatusFilter(status) {
    const statusMap = {
      0: 'none',
      1: '未推拉流',
      2: '流建立中',
      3: '流建立中',
      4: '流建立中',
      5: '推拉流中'
    }
    return statusMap[status]
  },
  sessionStatusColorFilter(status) {
    const statusMap = {
      0: 'info',
      1: 'danger',
      2: 'warning',
      3: 'warning',
      4: 'warning',
      5: 'success'
    }
    return statusMap[status]
  },
  sendRecvColorFilter(status) {
    return status ? 'success' : 'danger'
  },
  roomModeFilter(mode) {
    const modeMap = {
      255: '无效',
      0: 'UP-MCU',
      1: 'CP-MCU',
      2: 'UP-SFU',
      3: 'CP-SFU'
    }
    return modeMap[mode]
  },
  picModeFilter(mode) {
    const modeMap = {
      0: '一大多小',
      1: '等大'
    }
    return modeMap[mode]
  },
  roomIdFilter(id) {
    if (id === 0xffffffff) { return '无效' } else { return id }
  },
  callIdxFilter(id) {
    if (id === 0xffff) { return '无效' } else { return id }
  },
  callIdxColorFilter(id) {
    if (id === 0xffff) { return 'danger' } else { return 'success' }
  }
}
export default vFilter
